home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.04 Apr 95 / TreeAppƒ / Eric's C++ Libraries / Interface Classes / CPPMenuBar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  1.6 KB  |  59 lines  |  [TEXT/KAHL]

  1. /***************************************************** IMPLEMENTATION
  2.     DATE:    9/20/93
  3.     AUTHOR: Eric R. Rosé
  4.  
  5.     CLASS:  CPPMenuBar
  6.     
  7.     SUPERCLASS: CPPObject
  8.     
  9.         This C++ class manages a Macintosh menu bar
  10.     
  11. ********************************************************************/
  12.  
  13. #pragma once
  14.  
  15. #include <CPPList.h>
  16.  
  17. class CPPMenuBar : public CPPList {
  18. public:
  19.             CPPMenuBar (short ResID, short appleID);
  20.             CPPMenuBar (void);
  21.             ~CPPMenuBar (void);
  22.  
  23.     virtual    char    *ClassName (void);
  24.     virtual    Boolean    Member (char *className);
  25.         
  26.     void    DoMenu (short menuID, short theItem);
  27.     void    DoMenu (long menuResult);
  28.     MenuHandle    MenuFromID (short ResID);
  29.     void    BindCommand (short MenuID, short ItemID, short CommandID);
  30.  
  31.     void    CheckCommand (short CommandID, Boolean doCheck);
  32.     void    EnableCommand (short CommandID);
  33.     void    DisableCommand (short CommandID);
  34.     void    MarkCommand    (short CommandID, char markChar);
  35.     void    SetCommandText (short CommandID, StringPtr theString);
  36.     void    SetCommandIcon (short CommandID, short theIconID);
  37.     void    SetCommandStyle (short CommandID, Style newStyle);
  38.  
  39.     void    SetUpHierMenus (short startID, short endID);
  40.  
  41.     void    EnableMenuBar (void);
  42.     void    DisableMenuBar (void);
  43.  
  44. protected:
  45.     void    AddDAs (short ResID);
  46.     void    AddDAs (MenuHandle theMenu);
  47.     void    DoAppleMenuItem (short appleMenuID, short theItem);
  48.                 
  49.     short    MenuToCommand (short menuID, short itemID);
  50.     Boolean    CommandToMenuAndItem (short commandID, short *menuID, short *itemID);
  51.     Boolean    CommandToMenu (short commandID, MenuHandle *theMenu, short *itemID);
  52.  
  53.     virtual    void    SetCommandBindings (void);
  54.                 
  55. private:
  56.     Handle    theMenuBar;
  57.     MenuHandle    appleMenu;
  58.     short        appleMenuID;
  59. };